<!DOCTYPE html>
<html ng-app>
<head lang="en">
    <meta charset="UTF-8">
    <title>sample</title>
    <script type="text/javascript" src="../../lib/jquery/1.11.0/jquery.min.js"></script>
    <script type="text/javascript" src="../../lib/angularjs/1.3.0-beta.5/angular.js"></script>
</head>
<body>
<form name="test_fomr" ng-controller="FormController" ng-init="">
    <select ng-model="a" ng-options="x for x in o" ng-change="show()">
        <option value="">空值</option>
    </select>
    <br/>

    <select ng-model="b" ng-options="x.name for x in o1" ng-change="show1()">
    </select>
    <br/>

    <select ng-model="c" ng-options="x.v as x.name for x in o2" ng-change="show2()">
    </select>
    <br/>

    <select ng-model="d" ng-options="x.name group by x.g for x in o3" ng-change="show3()">
    </select>
    <br/>

    <select ng-model="e" ng-options="x.v as x.name group by x.g for x in o4" ng-change="show4()">
    </select>
    <br/>

    <select ng-model="f" ng-options="v.v as v.name for (k, v) in o5" ng-change="show5()">
    </select>
    <br/>

    <select ng-model="g" ng-options="k for (k, v) in o6" ng-change="show6()">
    </select>
    <br/>

    <select ng-model="h" ng-options="v.name group by v.g for (k, v) in o7" ng-change="show7()">
    </select>
    <br/>

    <select ng-model="i" ng-options="v.v as v.name group by v.g for (k, v) in o8" ng-change="show8()">
    </select>
    <br/>
</form>
<script type="text/javascript">
    var FormController = ['$scope', function ($scope) {
        $scope.o = [0, 1, 2, 3];
        $scope.a = $scope.o[2];
        $scope.show = function () {
            console.log($scope.a);
        };

        $scope.o1 = [
            {name: 'AA', v: '123'},
            {name: 'BB', v: '456'}
        ];
        $scope.b = $scope.o1[1];
        $scope.show1 = function () {
            console.log($scope.b);
        };

        $scope.o2 = [
            {name: 'CC', v: '00'},
            {name: 'DD', v: '11'}
        ];
        $scope.c = $scope.o2[1].v;
        $scope.show2 = function () {
            console.log($scope.c);
        };

        $scope.o3 = [
            {name: 'AA', g: '00'},
            {name: 'BB', g: '11'},
            {name: 'CC', g: '00'}
        ];
        $scope.d = $scope.o3[1];
        $scope.show3 = function () {
            console.log($scope.d);
        };

        $scope.o4 = [
            {name: 'AA', g: '00', v: '='},
            {name: 'BB', g: '11', v: '+'},
            {name: 'CC', g: '00', v: '!'}
        ];
        $scope.e = $scope.o4[1].v;
        $scope.show4 = function () {
            console.log($scope.e);
        };

        $scope.o5 = {a: {name: 'AA', v: 'a'}, b: {name: 'BB', v: 'b'}, c: {name: 'CC', v: 'c'}};
        $scope.f = $scope.o5.a.v;
        $scope.show5 = function () {
            console.log($scope.f);
        };

        $scope.o6 = {a: 0, b: 1};
        $scope.g = $scope.o6.a;
        $scope.show6 = function () {
            console.log($scope.g);
        };

        $scope.o7 = {a: {name: 'AA', v: '00', g: '=='}, b: {name: 'BB', v: '11', g: '=='}, b: {name: 'CC', v: '22', g: '--'}};
        $scope.h = $scope.o7.a;
        $scope.show7 = function () {
            console.log($scope.h);
        };

        $scope.o8 = {a: {name: 'AA', v: '00', g: '=='}, b: {name: 'BB', v: '11', g: '=='}};
        $scope.i = $scope.o8.a.v;
        $scope.show8 = function () {
            console.log($scope.i);
        };
    }];
</script>
</body>
</html>